package com.mingqijia.gassafety.authority.api.req.role;

import com.mingqijia.gassafety.shared.constant.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 创建请求
 * @author Damon S.
 * @version v0.2
 * @date 2021-06-19
 */
@Data
@ApiModel(value = "创建角色请求")
public class CreateRoleReqDTO implements Serializable {

    @NotNull(message = "角色名称不能为空")
    @ApiModelProperty(value = "角色", required = true)
    @Pattern(regexp = Constants.REGEXP_NAME, message = "账号应满足2-16位汉字、字母、数字")
    private String name;

    @ApiModelProperty(value = "角色描述")
    @Length(max = 200, message = "支持200个字以内的说明")
    private String description;

}
